package com.sky.service.impl;

import com.sky.domain.Admin;
import com.sky.domain.LoginForm;
import com.sky.mapper.AdminMapper;
import com.sky.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author 尹稳健~
 * 业务层实现类-操控管理员信息
 * @version 1.0
 */
@Service
@Transactional
public class AdminServiceImpl implements AdminService {

    @Autowired
    private AdminMapper adminMapper;

    public Admin login(LoginForm loginForm) {
        return adminMapper.login(loginForm);
    }

    public void updatePassword(Admin admin) {
        adminMapper.updatePassword(admin);
    }

    public List<Admin> getAdminList(String username) {
        return adminMapper.getAdminList(username);
    }

    public Admin findAdminByName(Admin admin) {
        return adminMapper.findAdminByName(admin);
    }

    public void addAdmin(Admin admin) {
        adminMapper.addAdmin(admin);
    }

    public void editAdmin(Admin admin) {
        adminMapper.editAdmin(admin);
    }

    public void deleteAdmin(Integer[] ids) {
        adminMapper.deleteAdmin(ids);
    }
}
